package com.wangyuhang.dao;

import com.wangyuhang.domain.User;
import org.apache.ibatis.annotations.*;

import java.util.List;

public interface userDao {
    @Select("select * from user where id=#{id}")
    User findById(Integer id);

    @Select("select * from user")
    List<User> findAll();

    @Delete("delete from user where id=#{id}")
    boolean deleteById(Integer id);

    @Insert("insert into user values(#{id},#{name},#{age},#{sex})")
    void save(User user);

    @Update("update user set name=#{name},age=#{age},sex=#{sex} where id=#{id}")
    void update(User user);
}
